\(\int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [212]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 31, antiderivative size = 296 \[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {2 (e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}+\frac {4 f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}+\frac {4 f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^3}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}+\frac {f^2 \operatorname {PolyLog}\left (2,e^{2 (c+d x)}\right )}{a d^3}-\frac {2 i f^2 \operatorname {PolyLog}\left (3,-e^{c+d x}\right )}{a d^3}+\frac {2 i f^2 \operatorname {PolyLog}\left (3,e^{c+d x}\right )}{a d^3}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d} \]

[Out]

-2*(f*x+e)^2/a/d+2*I*(f*x+e)^2*arctanh(exp(d*x+c))/a/d-(f*x+e)^2*coth(d*x+c)/a/d+4*f*(f*x+e)*ln(1+I*exp(d*x+c)
)/a/d^2+2*f*(f*x+e)*ln(1-exp(2*d*x+2*c))/a/d^2+2*I*f*(f*x+e)*polylog(2,-exp(d*x+c))/a/d^2+4*f^2*polylog(2,-I*e
xp(d*x+c))/a/d^3-2*I*f*(f*x+e)*polylog(2,exp(d*x+c))/a/d^2+f^2*polylog(2,exp(2*d*x+2*c))/a/d^3-2*I*f^2*polylog
(3,-exp(d*x+c))/a/d^3+2*I*f^2*polylog(3,exp(d*x+c))/a/d^3-(f*x+e)^2*tanh(1/2*c+1/4*I*Pi+1/2*d*x)/a/d

Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 296, normalized size of antiderivative = 1.00, number of steps used = 20, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.355, Rules used = {5694, 4269, 3797, 2221, 2317, 2438, 4267, 2611, 2320, 6724, 3399} \[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}+\frac {4 f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^3}+\frac {f^2 \operatorname {PolyLog}\left (2,e^{2 (c+d x)}\right )}{a d^3}-\frac {2 i f^2 \operatorname {PolyLog}\left (3,-e^{c+d x}\right )}{a d^3}+\frac {2 i f^2 \operatorname {PolyLog}\left (3,e^{c+d x}\right )}{a d^3}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}+\frac {4 f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {d x}{2}+\frac {i \pi }{4}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}-\frac {2 (e+f x)^2}{a d} \]

[In]

Int[((e + f*x)^2*Csch[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

(-2*(e + f*x)^2)/(a*d) + ((2*I)*(e + f*x)^2*ArcTanh[E^(c + d*x)])/(a*d) - ((e + f*x)^2*Coth[c + d*x])/(a*d) +
(4*f*(e + f*x)*Log[1 + I*E^(c + d*x)])/(a*d^2) + (2*f*(e + f*x)*Log[1 - E^(2*(c + d*x))])/(a*d^2) + ((2*I)*f*(
e + f*x)*PolyLog[2, -E^(c + d*x)])/(a*d^2) + (4*f^2*PolyLog[2, (-I)*E^(c + d*x)])/(a*d^3) - ((2*I)*f*(e + f*x)
*PolyLog[2, E^(c + d*x)])/(a*d^2) + (f^2*PolyLog[2, E^(2*(c + d*x))])/(a*d^3) - ((2*I)*f^2*PolyLog[3, -E^(c +
d*x)])/(a*d^3) + ((2*I)*f^2*PolyLog[3, E^(c + d*x)])/(a*d^3) - ((e + f*x)^2*Tanh[c/2 + (I/4)*Pi + (d*x)/2])/(a
*d)

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 3399

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(2*a)^n, Int[(c
 + d*x)^m*Sin[(1/2)*(e + Pi*(a/(2*b))) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2
- b^2, 0] && IntegerQ[n] && (GtQ[n, 0] || IGtQ[m, 0])

Rule 3797

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)], x_Symbol] :> Simp[(-I)*((
c + d*x)^(m + 1)/(d*(m + 1))), x] + Dist[2*I, Int[((c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*
fz*x))/E^(2*I*k*Pi))))/E^(2*I*k*Pi), x], x] /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[4*k] && IGtQ[m, 0]

Rule 4267

Int[csc[(e_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(Ar
cTanh[E^((-I)*e + f*fz*x)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 - E^((-I)*e + f*
fz*x)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e + f*fz*x)], x], x]) /; FreeQ[{c,
 d, e, f, fz}, x] && IGtQ[m, 0]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 5694

Int[(Csch[(c_.) + (d_.)*(x_)]^(n_.)*((e_.) + (f_.)*(x_))^(m_.))/((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]), x_Sym
bol] :> Dist[1/a, Int[(e + f*x)^m*Csch[c + d*x]^n, x], x] - Dist[b/a, Int[(e + f*x)^m*(Csch[c + d*x]^(n - 1)/(
a + b*Sinh[c + d*x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps \begin{align*} \text {integral}& = -\left (i \int \frac {(e+f x)^2 \text {csch}(c+d x)}{a+i a \sinh (c+d x)} \, dx\right )+\frac {\int (e+f x)^2 \text {csch}^2(c+d x) \, dx}{a} \\ & = -\frac {(e+f x)^2 \coth (c+d x)}{a d}-\frac {i \int (e+f x)^2 \text {csch}(c+d x) \, dx}{a}+\frac {(2 f) \int (e+f x) \coth (c+d x) \, dx}{a d}-\int \frac {(e+f x)^2}{a+i a \sinh (c+d x)} \, dx \\ & = -\frac {(e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}-\frac {\int (e+f x)^2 \csc ^2\left (\frac {1}{2} \left (i c+\frac {\pi }{2}\right )+\frac {i d x}{2}\right ) \, dx}{2 a}+\frac {(2 i f) \int (e+f x) \log \left (1-e^{c+d x}\right ) \, dx}{a d}-\frac {(2 i f) \int (e+f x) \log \left (1+e^{c+d x}\right ) \, dx}{a d}-\frac {(4 f) \int \frac {e^{2 (c+d x)} (e+f x)}{1-e^{2 (c+d x)}} \, dx}{a d} \\ & = -\frac {(e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}+\frac {(2 f) \int (e+f x) \coth \left (\frac {c}{2}-\frac {i \pi }{4}+\frac {d x}{2}\right ) \, dx}{a d}-\frac {\left (2 i f^2\right ) \int \operatorname {PolyLog}\left (2,-e^{c+d x}\right ) \, dx}{a d^2}+\frac {\left (2 i f^2\right ) \int \operatorname {PolyLog}\left (2,e^{c+d x}\right ) \, dx}{a d^2}-\frac {\left (2 f^2\right ) \int \log \left (1-e^{2 (c+d x)}\right ) \, dx}{a d^2} \\ & = -\frac {2 (e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}+\frac {(4 i f) \int \frac {e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )} (e+f x)}{1+i e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )}} \, dx}{a d}-\frac {\left (2 i f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-x)}{x} \, dx,x,e^{c+d x}\right )}{a d^3}+\frac {\left (2 i f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,x)}{x} \, dx,x,e^{c+d x}\right )}{a d^3}-\frac {f^2 \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 (c+d x)}\right )}{a d^3} \\ & = -\frac {2 (e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}+\frac {4 f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}+\frac {f^2 \operatorname {PolyLog}\left (2,e^{2 (c+d x)}\right )}{a d^3}-\frac {2 i f^2 \operatorname {PolyLog}\left (3,-e^{c+d x}\right )}{a d^3}+\frac {2 i f^2 \operatorname {PolyLog}\left (3,e^{c+d x}\right )}{a d^3}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {\left (4 f^2\right ) \int \log \left (1+i e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )}\right ) \, dx}{a d^2} \\ & = -\frac {2 (e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}+\frac {4 f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}+\frac {f^2 \operatorname {PolyLog}\left (2,e^{2 (c+d x)}\right )}{a d^3}-\frac {2 i f^2 \operatorname {PolyLog}\left (3,-e^{c+d x}\right )}{a d^3}+\frac {2 i f^2 \operatorname {PolyLog}\left (3,e^{c+d x}\right )}{a d^3}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d}-\frac {\left (4 f^2\right ) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{2 \left (\frac {c}{2}+\frac {d x}{2}\right )}\right )}{a d^3} \\ & = -\frac {2 (e+f x)^2}{a d}+\frac {2 i (e+f x)^2 \text {arctanh}\left (e^{c+d x}\right )}{a d}-\frac {(e+f x)^2 \coth (c+d x)}{a d}+\frac {4 f (e+f x) \log \left (1+i e^{c+d x}\right )}{a d^2}+\frac {2 f (e+f x) \log \left (1-e^{2 (c+d x)}\right )}{a d^2}+\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,-e^{c+d x}\right )}{a d^2}+\frac {4 f^2 \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^3}-\frac {2 i f (e+f x) \operatorname {PolyLog}\left (2,e^{c+d x}\right )}{a d^2}+\frac {f^2 \operatorname {PolyLog}\left (2,e^{2 (c+d x)}\right )}{a d^3}-\frac {2 i f^2 \operatorname {PolyLog}\left (3,-e^{c+d x}\right )}{a d^3}+\frac {2 i f^2 \operatorname {PolyLog}\left (3,e^{c+d x}\right )}{a d^3}-\frac {(e+f x)^2 \tanh \left (\frac {c}{2}+\frac {i \pi }{4}+\frac {d x}{2}\right )}{a d} \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(803\) vs. \(2(296)=592\).

Time = 8.08 (sec) , antiderivative size = 803, normalized size of antiderivative = 2.71 \[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {4 i e^c f \left (\frac {e^{-c} (e+f x)^2}{2 f}+\frac {\left (i+e^{-c}\right ) (e+f x) \log \left (1-i e^{-c-d x}\right )}{d}-\frac {e^{-c} \left (1+i e^c\right ) f \operatorname {PolyLog}\left (2,i e^{-c-d x}\right )}{d^2}\right )}{a d \left (-i+e^c\right )}+\frac {i d^2 e \left (-1+e^{2 c}\right ) (d e+2 i f) x+d^2 e \left (1-e^{2 c}\right ) (i d e+2 f) x-2 d^2 (e+f x)^2+2 d \left (-1+e^{2 c}\right ) f (-i d e+f) x \log \left (1-e^{-c-d x}\right )-i d^2 \left (-1+e^{2 c}\right ) f^2 x^2 \log \left (1-e^{-c-d x}\right )+2 d \left (-1+e^{2 c}\right ) f (i d e+f) x \log \left (1+e^{-c-d x}\right )+i d^2 \left (-1+e^{2 c}\right ) f^2 x^2 \log \left (1+e^{-c-d x}\right )+d e \left (-1+e^{2 c}\right ) (-i d e+2 f) \log \left (1-e^{c+d x}\right )+d e \left (-1+e^{2 c}\right ) (i d e+2 f) \log \left (1+e^{c+d x}\right )-2 \left (-1+e^{2 c}\right ) f (i d e+f) \operatorname {PolyLog}\left (2,-e^{-c-d x}\right )-2 i d \left (-1+e^{2 c}\right ) f^2 x \operatorname {PolyLog}\left (2,-e^{-c-d x}\right )+2 i \left (-1+e^{2 c}\right ) (d e+i f) f \operatorname {PolyLog}\left (2,e^{-c-d x}\right )+2 i d \left (-1+e^{2 c}\right ) f^2 x \operatorname {PolyLog}\left (2,e^{-c-d x}\right )-2 i \left (-1+e^{2 c}\right ) f^2 \operatorname {PolyLog}\left (3,-e^{-c-d x}\right )+2 i \left (-1+e^{2 c}\right ) f^2 \operatorname {PolyLog}\left (3,e^{-c-d x}\right )}{a d^3 \left (-1+e^{2 c}\right )}+\frac {\text {sech}\left (\frac {c}{2}\right ) \text {sech}\left (\frac {c}{2}+\frac {d x}{2}\right ) \left (-e^2 \sinh \left (\frac {d x}{2}\right )-2 e f x \sinh \left (\frac {d x}{2}\right )-f^2 x^2 \sinh \left (\frac {d x}{2}\right )\right )}{2 a d}+\frac {\text {csch}\left (\frac {c}{2}\right ) \text {csch}\left (\frac {c}{2}+\frac {d x}{2}\right ) \left (e^2 \sinh \left (\frac {d x}{2}\right )+2 e f x \sinh \left (\frac {d x}{2}\right )+f^2 x^2 \sinh \left (\frac {d x}{2}\right )\right )}{2 a d}-\frac {2 \left (e^2 \sinh \left (\frac {d x}{2}\right )+2 e f x \sinh \left (\frac {d x}{2}\right )+f^2 x^2 \sinh \left (\frac {d x}{2}\right )\right )}{a d \left (\cosh \left (\frac {c}{2}\right )+i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {c}{2}+\frac {d x}{2}\right )+i \sinh \left (\frac {c}{2}+\frac {d x}{2}\right )\right )} \]

[In]

Integrate[((e + f*x)^2*Csch[c + d*x]^2)/(a + I*a*Sinh[c + d*x]),x]

[Out]

((-4*I)*E^c*f*((e + f*x)^2/(2*E^c*f) + ((I + E^(-c))*(e + f*x)*Log[1 - I*E^(-c - d*x)])/d - ((1 + I*E^c)*f*Pol
yLog[2, I*E^(-c - d*x)])/(d^2*E^c)))/(a*d*(-I + E^c)) + (I*d^2*e*(-1 + E^(2*c))*(d*e + (2*I)*f)*x + d^2*e*(1 -
 E^(2*c))*(I*d*e + 2*f)*x - 2*d^2*(e + f*x)^2 + 2*d*(-1 + E^(2*c))*f*((-I)*d*e + f)*x*Log[1 - E^(-c - d*x)] -
I*d^2*(-1 + E^(2*c))*f^2*x^2*Log[1 - E^(-c - d*x)] + 2*d*(-1 + E^(2*c))*f*(I*d*e + f)*x*Log[1 + E^(-c - d*x)]
+ I*d^2*(-1 + E^(2*c))*f^2*x^2*Log[1 + E^(-c - d*x)] + d*e*(-1 + E^(2*c))*((-I)*d*e + 2*f)*Log[1 - E^(c + d*x)
] + d*e*(-1 + E^(2*c))*(I*d*e + 2*f)*Log[1 + E^(c + d*x)] - 2*(-1 + E^(2*c))*f*(I*d*e + f)*PolyLog[2, -E^(-c -
 d*x)] - (2*I)*d*(-1 + E^(2*c))*f^2*x*PolyLog[2, -E^(-c - d*x)] + (2*I)*(-1 + E^(2*c))*(d*e + I*f)*f*PolyLog[2
, E^(-c - d*x)] + (2*I)*d*(-1 + E^(2*c))*f^2*x*PolyLog[2, E^(-c - d*x)] - (2*I)*(-1 + E^(2*c))*f^2*PolyLog[3,
-E^(-c - d*x)] + (2*I)*(-1 + E^(2*c))*f^2*PolyLog[3, E^(-c - d*x)])/(a*d^3*(-1 + E^(2*c))) + (Sech[c/2]*Sech[c
/2 + (d*x)/2]*(-(e^2*Sinh[(d*x)/2]) - 2*e*f*x*Sinh[(d*x)/2] - f^2*x^2*Sinh[(d*x)/2]))/(2*a*d) + (Csch[c/2]*Csc
h[c/2 + (d*x)/2]*(e^2*Sinh[(d*x)/2] + 2*e*f*x*Sinh[(d*x)/2] + f^2*x^2*Sinh[(d*x)/2]))/(2*a*d) - (2*(e^2*Sinh[(
d*x)/2] + 2*e*f*x*Sinh[(d*x)/2] + f^2*x^2*Sinh[(d*x)/2]))/(a*d*(Cosh[c/2] + I*Sinh[c/2])*(Cosh[c/2 + (d*x)/2]
+ I*Sinh[c/2 + (d*x)/2]))

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 888 vs. \(2 (275 ) = 550\).

Time = 2.52 (sec) , antiderivative size = 889, normalized size of antiderivative = 3.00

method result size
risch \(-\frac {4 f^{2} x^{2}}{a d}+\frac {8 f^{2} c \ln \left ({\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {2 f^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {2 f^{2} \operatorname {polylog}\left (2, {\mathrm e}^{d x +c}\right )}{a \,d^{3}}-\frac {8 f \ln \left ({\mathrm e}^{d x +c}\right ) e}{a \,d^{2}}-\frac {8 f^{2} c x}{a \,d^{2}}+\frac {2 f^{2} \ln \left (1-{\mathrm e}^{d x +c}\right ) x}{d^{2} a}+\frac {2 f^{2} \ln \left ({\mathrm e}^{d x +c}+1\right ) x}{d^{2} a}+\frac {2 f^{2} \ln \left (1-{\mathrm e}^{d x +c}\right ) c}{d^{3} a}-\frac {2 f^{2} c \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{d^{3} a}-\frac {2 f^{2} c \ln \left ({\mathrm e}^{d x +c}-1\right )}{d^{3} a}+\frac {2 e f \ln \left ({\mathrm e}^{d x +c}-1\right )}{d^{2} a}+\frac {2 e f \ln \left ({\mathrm e}^{d x +c}+1\right )}{d^{2} a}+\frac {2 e f \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{d^{2} a}-\frac {2 i e f \ln \left (1-{\mathrm e}^{d x +c}\right ) x}{d a}+\frac {2 i e f \ln \left ({\mathrm e}^{d x +c}+1\right ) x}{d a}-\frac {2 i e f \ln \left (1-{\mathrm e}^{d x +c}\right ) c}{d^{2} a}+\frac {2 i e c f \ln \left ({\mathrm e}^{d x +c}-1\right )}{d^{2} a}-\frac {4 f^{2} c^{2}}{a \,d^{3}}-\frac {i c^{2} f^{2} \ln \left ({\mathrm e}^{d x +c}-1\right )}{d^{3} a}+\frac {4 i e f \arctan \left ({\mathrm e}^{d x +c}\right )}{d^{2} a}+\frac {2 i e f \operatorname {polylog}\left (2, -{\mathrm e}^{d x +c}\right )}{d^{2} a}-\frac {2 i e f \operatorname {polylog}\left (2, {\mathrm e}^{d x +c}\right )}{d^{2} a}-\frac {2 i \left (f^{2} x^{2} {\mathrm e}^{2 d x +2 c}+2 e f x \,{\mathrm e}^{2 d x +2 c}+e^{2} {\mathrm e}^{2 d x +2 c}-2 x^{2} f^{2}-i {\mathrm e}^{d x +c} f^{2} x^{2}-4 e f x -2 i {\mathrm e}^{d x +c} e f x -2 e^{2}-i {\mathrm e}^{d x +c} e^{2}\right )}{\left ({\mathrm e}^{2 d x +2 c}-1\right ) \left ({\mathrm e}^{d x +c}-i\right ) a d}+\frac {i f^{2} \ln \left (1-{\mathrm e}^{d x +c}\right ) c^{2}}{d^{3} a}-\frac {i f^{2} \ln \left (1-{\mathrm e}^{d x +c}\right ) x^{2}}{d a}-\frac {2 i f^{2} \operatorname {polylog}\left (2, {\mathrm e}^{d x +c}\right ) x}{d^{2} a}+\frac {i f^{2} \ln \left ({\mathrm e}^{d x +c}+1\right ) x^{2}}{d a}+\frac {2 i f^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{d x +c}\right ) x}{d^{2} a}-\frac {4 i c \,f^{2} \arctan \left ({\mathrm e}^{d x +c}\right )}{d^{3} a}-\frac {2 i f^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {2 i f^{2} \operatorname {polylog}\left (3, {\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {i e^{2} \ln \left ({\mathrm e}^{d x +c}+1\right )}{d a}-\frac {i e^{2} \ln \left ({\mathrm e}^{d x +c}-1\right )}{d a}+\frac {4 f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) x}{a \,d^{2}}+\frac {4 f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{a \,d^{3}}+\frac {4 f^{2} \operatorname {polylog}\left (2, -i {\mathrm e}^{d x +c}\right )}{a \,d^{3}}\) \(889\)

[In]

int((f*x+e)^2*csch(d*x+c)^2/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

-4*f^2*x^2/a/d+8/a/d^3*f^2*c*ln(exp(d*x+c))-2*I*f^2*polylog(3,-exp(d*x+c))/a/d^3+2*f^2*polylog(2,-exp(d*x+c))/
a/d^3+2*f^2*polylog(2,exp(d*x+c))/a/d^3+4*f^2*polylog(2,-I*exp(d*x+c))/a/d^3-8/a/d^2*f*ln(exp(d*x+c))*e-8/a/d^
2*f^2*c*x+4/a/d^2*f^2*ln(1+I*exp(d*x+c))*x+4/a/d^3*f^2*ln(1+I*exp(d*x+c))*c+2*I*f^2*polylog(3,exp(d*x+c))/a/d^
3+2/d^2/a*f^2*ln(1-exp(d*x+c))*x+2/d^2/a*f^2*ln(exp(d*x+c)+1)*x+2/d^3/a*f^2*ln(1-exp(d*x+c))*c-2/d^3/a*f^2*c*l
n(1+exp(2*d*x+2*c))-2/d^3/a*f^2*c*ln(exp(d*x+c)-1)+I/d/a*e^2*ln(exp(d*x+c)+1)+2/d^2/a*e*f*ln(exp(d*x+c)-1)+2/d
^2/a*e*f*ln(exp(d*x+c)+1)+2/d^2/a*e*f*ln(1+exp(2*d*x+2*c))-I/d/a*e^2*ln(exp(d*x+c)-1)+I/d/a*f^2*ln(exp(d*x+c)+
1)*x^2+2*I/d^2/a*f^2*polylog(2,-exp(d*x+c))*x-4*I/d^3/a*c*f^2*arctan(exp(d*x+c))-I/d^3/a*c^2*f^2*ln(exp(d*x+c)
-1)+4*I/d^2/a*e*f*arctan(exp(d*x+c))+2*I/d^2/a*e*f*polylog(2,-exp(d*x+c))-2*I/d^2/a*e*f*polylog(2,exp(d*x+c))-
4/a/d^3*f^2*c^2-2*I/d/a*e*f*ln(1-exp(d*x+c))*x+2*I/d/a*e*f*ln(exp(d*x+c)+1)*x-2*I/d^2/a*e*f*ln(1-exp(d*x+c))*c
+2*I/d^2/a*e*c*f*ln(exp(d*x+c)-1)-2*I*(f^2*x^2*exp(2*d*x+2*c)+2*e*f*x*exp(2*d*x+2*c)+e^2*exp(2*d*x+2*c)-2*x^2*
f^2-I*exp(d*x+c)*f^2*x^2-4*e*f*x-2*I*exp(d*x+c)*e*f*x-2*e^2-I*exp(d*x+c)*e^2)/(exp(2*d*x+2*c)-1)/(exp(d*x+c)-I
)/a/d+I/d^3/a*f^2*ln(1-exp(d*x+c))*c^2-I/d/a*f^2*ln(1-exp(d*x+c))*x^2-2*I/d^2/a*f^2*polylog(2,exp(d*x+c))*x

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1355 vs. \(2 (263) = 526\).

Time = 0.28 (sec) , antiderivative size = 1355, normalized size of antiderivative = 4.58 \[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\text {Too large to display} \]

[In]

integrate((f*x+e)^2*csch(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

(4*I*d^2*e^2 - 8*I*c*d*e*f + 4*I*c^2*f^2 + 4*(f^2*e^(3*d*x + 3*c) - I*f^2*e^(2*d*x + 2*c) - f^2*e^(d*x + c) +
I*f^2)*dilog(-I*e^(d*x + c)) - 2*(d*f^2*x + d*e*f - I*f^2 + (-I*d*f^2*x - I*d*e*f - f^2)*e^(3*d*x + 3*c) - (d*
f^2*x + d*e*f - I*f^2)*e^(2*d*x + 2*c) + (I*d*f^2*x + I*d*e*f + f^2)*e^(d*x + c))*dilog(-e^(d*x + c)) + 2*(d*f
^2*x + d*e*f + I*f^2 - (I*d*f^2*x + I*d*e*f - f^2)*e^(3*d*x + 3*c) - (d*f^2*x + d*e*f + I*f^2)*e^(2*d*x + 2*c)
 - (-I*d*f^2*x - I*d*e*f + f^2)*e^(d*x + c))*dilog(e^(d*x + c)) - 4*(d^2*f^2*x^2 + 2*d^2*e*f*x + 2*c*d*e*f - c
^2*f^2)*e^(3*d*x + 3*c) - 2*(-I*d^2*f^2*x^2 - 2*I*d^2*e*f*x + I*d^2*e^2 - 4*I*c*d*e*f + 2*I*c^2*f^2)*e^(2*d*x
+ 2*c) + 2*(d^2*f^2*x^2 + 2*d^2*e*f*x - d^2*e^2 + 4*c*d*e*f - 2*c^2*f^2)*e^(d*x + c) - (d^2*f^2*x^2 + d^2*e^2
- 2*I*d*e*f + 2*(d^2*e*f - I*d*f^2)*x - (I*d^2*f^2*x^2 + I*d^2*e^2 + 2*d*e*f - 2*(-I*d^2*e*f - d*f^2)*x)*e^(3*
d*x + 3*c) - (d^2*f^2*x^2 + d^2*e^2 - 2*I*d*e*f + 2*(d^2*e*f - I*d*f^2)*x)*e^(2*d*x + 2*c) - (-I*d^2*f^2*x^2 -
 I*d^2*e^2 - 2*d*e*f - 2*(I*d^2*e*f + d*f^2)*x)*e^(d*x + c))*log(e^(d*x + c) + 1) - 4*(-I*d*e*f + I*c*f^2 - (d
*e*f - c*f^2)*e^(3*d*x + 3*c) + (I*d*e*f - I*c*f^2)*e^(2*d*x + 2*c) + (d*e*f - c*f^2)*e^(d*x + c))*log(e^(d*x
+ c) - I) + (d^2*e^2 - 2*(c - I)*d*e*f + (c^2 - 2*I*c)*f^2 + (-I*d^2*e^2 - 2*(-I*c - 1)*d*e*f + (-I*c^2 - 2*c)
*f^2)*e^(3*d*x + 3*c) - (d^2*e^2 - 2*(c - I)*d*e*f + (c^2 - 2*I*c)*f^2)*e^(2*d*x + 2*c) + (I*d^2*e^2 - 2*(I*c
+ 1)*d*e*f + (I*c^2 + 2*c)*f^2)*e^(d*x + c))*log(e^(d*x + c) - 1) - 4*(-I*d*f^2*x - I*c*f^2 - (d*f^2*x + c*f^2
)*e^(3*d*x + 3*c) + (I*d*f^2*x + I*c*f^2)*e^(2*d*x + 2*c) + (d*f^2*x + c*f^2)*e^(d*x + c))*log(I*e^(d*x + c) +
 1) + (d^2*f^2*x^2 + 2*c*d*e*f - (c^2 - 2*I*c)*f^2 + 2*(d^2*e*f + I*d*f^2)*x + (-I*d^2*f^2*x^2 - 2*I*c*d*e*f +
 (I*c^2 + 2*c)*f^2 - 2*(I*d^2*e*f - d*f^2)*x)*e^(3*d*x + 3*c) - (d^2*f^2*x^2 + 2*c*d*e*f - (c^2 - 2*I*c)*f^2 +
 2*(d^2*e*f + I*d*f^2)*x)*e^(2*d*x + 2*c) + (I*d^2*f^2*x^2 + 2*I*c*d*e*f + (-I*c^2 - 2*c)*f^2 - 2*(-I*d^2*e*f
+ d*f^2)*x)*e^(d*x + c))*log(-e^(d*x + c) + 1) - 2*(I*f^2*e^(3*d*x + 3*c) + f^2*e^(2*d*x + 2*c) - I*f^2*e^(d*x
 + c) - f^2)*polylog(3, -e^(d*x + c)) - 2*(-I*f^2*e^(3*d*x + 3*c) - f^2*e^(2*d*x + 2*c) + I*f^2*e^(d*x + c) +
f^2)*polylog(3, e^(d*x + c)))/(a*d^3*e^(3*d*x + 3*c) - I*a*d^3*e^(2*d*x + 2*c) - a*d^3*e^(d*x + c) + I*a*d^3)

Sympy [F]

\[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=- \frac {i \left (\int \frac {e^{2} \operatorname {csch}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f^{2} x^{2} \operatorname {csch}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {2 e f x \operatorname {csch}^{2}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \]

[In]

integrate((f*x+e)**2*csch(d*x+c)**2/(a+I*a*sinh(d*x+c)),x)

[Out]

-I*(Integral(e**2*csch(c + d*x)**2/(sinh(c + d*x) - I), x) + Integral(f**2*x**2*csch(c + d*x)**2/(sinh(c + d*x
) - I), x) + Integral(2*e*f*x*csch(c + d*x)**2/(sinh(c + d*x) - I), x))/a

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 601 vs. \(2 (263) = 526\).

Time = 0.42 (sec) , antiderivative size = 601, normalized size of antiderivative = 2.03 \[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=-e^{2} {\left (\frac {2 \, {\left (e^{\left (-d x - c\right )} - i \, e^{\left (-2 \, d x - 2 \, c\right )} + 2 i\right )}}{{\left (a e^{\left (-d x - c\right )} - i \, a e^{\left (-2 \, d x - 2 \, c\right )} - a e^{\left (-3 \, d x - 3 \, c\right )} + i \, a\right )} d} - \frac {i \, \log \left (e^{\left (-d x - c\right )} + 1\right )}{a d} + \frac {i \, \log \left (e^{\left (-d x - c\right )} - 1\right )}{a d}\right )} - \frac {2 \, f^{2} x^{2}}{a d} - \frac {8 \, e f x}{a d} - \frac {2 \, {\left (-2 i \, f^{2} x^{2} - 4 i \, e f x - {\left (-i \, f^{2} x^{2} e^{\left (2 \, c\right )} - 2 i \, e f x e^{\left (2 \, c\right )}\right )} e^{\left (2 \, d x\right )} + {\left (f^{2} x^{2} e^{c} + 2 \, e f x e^{c}\right )} e^{\left (d x\right )}\right )}}{a d e^{\left (3 \, d x + 3 \, c\right )} - i \, a d e^{\left (2 \, d x + 2 \, c\right )} - a d e^{\left (d x + c\right )} + i \, a d} + \frac {2 \, e f \log \left (e^{\left (d x + c\right )} + 1\right )}{a d^{2}} + \frac {4 \, e f \log \left (e^{\left (d x + c\right )} - i\right )}{a d^{2}} + \frac {2 \, e f \log \left (e^{\left (d x + c\right )} - 1\right )}{a d^{2}} + \frac {i \, {\left (d^{2} x^{2} \log \left (e^{\left (d x + c\right )} + 1\right ) + 2 \, d x {\rm Li}_2\left (-e^{\left (d x + c\right )}\right ) - 2 \, {\rm Li}_{3}(-e^{\left (d x + c\right )})\right )} f^{2}}{a d^{3}} - \frac {i \, {\left (d^{2} x^{2} \log \left (-e^{\left (d x + c\right )} + 1\right ) + 2 \, d x {\rm Li}_2\left (e^{\left (d x + c\right )}\right ) - 2 \, {\rm Li}_{3}(e^{\left (d x + c\right )})\right )} f^{2}}{a d^{3}} + \frac {4 \, {\left (d x \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right )\right )} f^{2}}{a d^{3}} - \frac {2 \, {\left (-i \, d e f - f^{2}\right )} {\left (d x \log \left (e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (d x + c\right )}\right )\right )}}{a d^{3}} + \frac {2 \, {\left (-i \, d e f + f^{2}\right )} {\left (d x \log \left (-e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (e^{\left (d x + c\right )}\right )\right )}}{a d^{3}} + \frac {i \, d^{3} f^{2} x^{3} - 3 \, {\left (-i \, d e f + f^{2}\right )} d^{2} x^{2}}{3 \, a d^{3}} - \frac {i \, d^{3} f^{2} x^{3} - 3 \, {\left (-i \, d e f - f^{2}\right )} d^{2} x^{2}}{3 \, a d^{3}} \]

[In]

integrate((f*x+e)^2*csch(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

-e^2*(2*(e^(-d*x - c) - I*e^(-2*d*x - 2*c) + 2*I)/((a*e^(-d*x - c) - I*a*e^(-2*d*x - 2*c) - a*e^(-3*d*x - 3*c)
 + I*a)*d) - I*log(e^(-d*x - c) + 1)/(a*d) + I*log(e^(-d*x - c) - 1)/(a*d)) - 2*f^2*x^2/(a*d) - 8*e*f*x/(a*d)
- 2*(-2*I*f^2*x^2 - 4*I*e*f*x - (-I*f^2*x^2*e^(2*c) - 2*I*e*f*x*e^(2*c))*e^(2*d*x) + (f^2*x^2*e^c + 2*e*f*x*e^
c)*e^(d*x))/(a*d*e^(3*d*x + 3*c) - I*a*d*e^(2*d*x + 2*c) - a*d*e^(d*x + c) + I*a*d) + 2*e*f*log(e^(d*x + c) +
1)/(a*d^2) + 4*e*f*log(e^(d*x + c) - I)/(a*d^2) + 2*e*f*log(e^(d*x + c) - 1)/(a*d^2) + I*(d^2*x^2*log(e^(d*x +
 c) + 1) + 2*d*x*dilog(-e^(d*x + c)) - 2*polylog(3, -e^(d*x + c)))*f^2/(a*d^3) - I*(d^2*x^2*log(-e^(d*x + c) +
 1) + 2*d*x*dilog(e^(d*x + c)) - 2*polylog(3, e^(d*x + c)))*f^2/(a*d^3) + 4*(d*x*log(I*e^(d*x + c) + 1) + dilo
g(-I*e^(d*x + c)))*f^2/(a*d^3) - 2*(-I*d*e*f - f^2)*(d*x*log(e^(d*x + c) + 1) + dilog(-e^(d*x + c)))/(a*d^3) +
 2*(-I*d*e*f + f^2)*(d*x*log(-e^(d*x + c) + 1) + dilog(e^(d*x + c)))/(a*d^3) + 1/3*(I*d^3*f^2*x^3 - 3*(-I*d*e*
f + f^2)*d^2*x^2)/(a*d^3) - 1/3*(I*d^3*f^2*x^3 - 3*(-I*d*e*f - f^2)*d^2*x^2)/(a*d^3)

Giac [F]

\[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )}^{2} \operatorname {csch}\left (d x + c\right )^{2}}{i \, a \sinh \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((f*x+e)^2*csch(d*x+c)^2/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)^2*csch(d*x + c)^2/(I*a*sinh(d*x + c) + a), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {(e+f x)^2 \text {csch}^2(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int \frac {{\left (e+f\,x\right )}^2}{{\mathrm {sinh}\left (c+d\,x\right )}^2\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \]

[In]

int((e + f*x)^2/(sinh(c + d*x)^2*(a + a*sinh(c + d*x)*1i)),x)

[Out]

int((e + f*x)^2/(sinh(c + d*x)^2*(a + a*sinh(c + d*x)*1i)), x)